<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ page import="weaver.general.BaseBean" %>
<%@ page import="net.sf.json.JSONObject" %>
<%@ page import="weaver.hrm.HrmUserVarify" %>
<%@ page import="weaver.hrm.User" %>
<%@ page import="weaver.general.Util" %>
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page"/>


<%
    User user = HrmUserVarify.getUser( request, response );
    String userid = Util.getNumStr( user.getUID() );
    String hasRightbtn = "0";
    BaseBean baseBean = new BaseBean();
    String sql = "select tsfqqx from uf_fwlxlcppb";
    rs.execute(sql);
    int count = 0;
    int count1 = 0;
    while (rs.next()){
        String tsfqqx = Util.null2String( rs.getString( "tsfqqx" ) );
        if(tsfqqx.indexOf(",") >=0){
            String[] strings = tsfqqx.split( "," );
            for (String s : strings) {
                if (userid.contains( s )) {
                    count++;
                }
            }
        }else {
         if(userid.equals(tsfqqx)){
             count1++;
         }
        }
    }
    baseBean.writeLog("count="+count+",count1="+count1);
    if(count>0 || count1>0){
        hasRightbtn = "1";
    }
    JSONObject jsonObject = new JSONObject();
    jsonObject.put( "hasRightbtn", hasRightbtn );
    out.print( jsonObject.toString() );

%>
